<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      >
<head th:replace="~{fragments/header :: header}">
</head>
<body>
<!-- Page Content -->
<div class="container blog-content-container">

    <div class="row">

        <!-- Blog Entries Column -->
        <div class="col-md-8">
            <!-- Blog Post -->
            <div id="mainContainer">
                <div id="mainContainerRepleace">
                    <div class="card mb-4" th:each="blog : ${blogList}">
                        <div class="card-block">
                            <h2 class="card-title">
		                 		<span>
				                  <a href="/u/waylau" title="waylau" th:href="'/blog/space/' + ${blog.username}"  th:title="${blog.username}">
				                    <img src="/images/avatar-defualt.jpg" th:src="${blog.header} == null ? '/images/avatar-defualt.jpg' :'http://'+${blog.header}"  class="blog-avatar-50">
				                  </a>
						        </span>
                                <a href="/u/waylau/blogs/1" class="card-link" title="waylau"
                                   th:href="'/blog/space/' + ${blog.username} + '/blogs/'+ ${blog.blogId}"  th:title="${blog.title}" th:text="${blog.title}">
                                    OAuth 2.0 认证的原理与实践
                                </a>
                            </h2>
                            <p class="card-text" th:text="${blog.summary}">使用 OAuth 2.0 认证的的好处是显然易见的。你只需要用同一个账号密码，就能在各个网站进行访问，而免去了在每个网站都进行注册的繁琐过程。 本文将介绍
                                OAuth 2.0 的原理，并基于 Spring Security 和 GitHub 账号，来演示 OAuth 2.0 的认证的过程。</p>
                            <div class="card-text">
                                <a href="/u/waylau" th:href="'/blog/space/' + ${blog.username}" class="card-link" th:text=${blog.username}>waylau</a> 发表于 [[${#dates.format(blog.createTime, 'yyyy-MM-dd HH:mm')}]] <i class="fa fa-eye" aria-hidden="true">[[${blog.reading}]]</i>
                                <i class="fa fa-heart-o" aria-hidden="true">[[${blog.likes}]]</i> <i class="fa fa-comment-o"
                                                                                                        aria-hidden="true">[[${blog.comments}]]</i>
                            </div>
                        </div>
                    </div>
                    <div th:replace="~{fragments/page :: page}">...</div>
                </div>
            </div>
        </div>

    <!-- 右侧栏目 -->
    <div class="col-md-4">
        <div>
            <!-- 热门标签 -->
            <div class="card ">
                <h5 class="card-header"><i class="fa fa-tags" aria-hidden="true"></i> 热门标签</h5>
                <div class="card-block">
                    <div class="row">
                        <div class="col-lg-12" >
                            <a th:each="tag, tagStat : ${tags}" th:object="${tag}" href="/blog/blogs?keyword=1" th:href="'/blog/blogs?keyword=' +  *{name}"> <span class="badge"
                                                                                                                                                         th:classappend="${tagStat.index} eq 0 ? 'badge-danger': (${tagStat.index} eq 1 ? 'badge-warning':(${tagStat.index} eq 2 ? 'badge-info':'badge-default'))"th:text="*{name}">Web Design</span></a>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 热门用户 -->
            <div class="card my-4">
                <h5 class="card-header"><i class="fa fa-users" aria-hidden="true"></i> 热门用户</h5>
                <div class="card-block">
                    <div class="row">
                        <div class="col-lg-12">
								<span th:each="user: ${users}" th:object="${user}">
				                  <a href="/u/waylau" th:href="'/blog/space/' + *{username}" title="waylau" th:title="*{username}">
				                    <img src="/images/avatar-defualt.jpg" th:src="*{header} == null ? '/images/avatar-defualt.jpg' : 'http://'+*{header}" class="blog-avatar-50">
				                  </a>
				                </span>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 热门文章 -->
            <div class="card my-4">
                <h5 class="card-header"><i class="fa fa-fire" aria-hidden="true"></i> 热门文章</h5>

                <ul class="list-group" th:each="hotblog , hotblogStat : ${hotest}" th:object="${hotblog}">
                    <a  th:href="'/blog/space/'+*{username} +'/blogs/'+ *{blogId}" class="list-group-item">
                        [[*{title}]]<span class="badge badge-pill" th:classappend="${hotblogStat.index} eq 0 ? 'badge-danger': (${hotblogStat.index} eq 1 ? 'badge-warning':(${hotblogStat.index} eq 2 ? 'badge-info':'badge-default'))">[[*{reading}]]</span>
                    </a>
                </ul>

            </div>

            <!-- 最新发布 -->
            <div class="card my-4">
                <h5 class="card-header"><i class="fa fa-line-chart" aria-hidden="true"></i> 最新发布</h5>
                <div class="list-group">
                    <ul class="list-group" th:each="newblog : ${newest}" th:object="${newblog}">
                        <a  th:href="'/blog/space/'+*{username} +'/blogs/'+ *{blogId}" class="list-group-item" th:text="*{title}">
                        </a>
                    </ul>
                </div>

            </div>
        </div>
    </div>

    </div>
    <!-- /.row -->
</div>
<!-- /.container -->

<div th:replace="~{fragments/footer :: footer}">...</div>


<!-- JavaScript -->
<script src="../../js/index.js" th:src="@{/js/index.js}"></script>
</body>
</html>